if item loop of scoreval>loop then if item loop of scoreval<4*loop then if doneit then put loop into whatnot1
else
put loop into whatnot
put true into doneit
end if
end repeat
if doneit then
clickonnot2 whatnot,whatnot1
exit holdfull
end if
end holdfull
on holdlstraight
global dicepos
put empty into t1
put empty into t2
put dicepos into dicepos1
repeat with loop=1 to 5
add item loop of dicepos to t1
add item loop+1 of dicepos to t2
end repeat
if t1>t2 then put 0 into item 6 of dicepos1
else put 0 into item 1 of dicepos1
repeat with loop1=1 to 5
if item ((icon of btn loop1)-2999) of dicepos1=0 then click at loc of btn loop1
else put 0 into item ((icon of btn loop1)-2999) of dicepos1
end repeat
end holdlstraight
on holdsstraight
global dicepos
put empty into t1
put empty into t2
put empty into t3
put dicepos into dicepos1
repeat with loop=1 to 4
add item loop of dicepos to t1
add item loop+1 of dicepos to t2
add item loop+2 of dicepos to t3
end repeat
put 0 into mx
if t1>mx then
put t1 into mx
put 1 into h
end if
if t2>=mx then
put t2 into mx
put 2 into h
end if
if t3>mx then
put t3 into mx
put 3 into h
end if
if h=3 then
put 0 into item 1 of dicepos1
put 0 into item 2 of dicepos1
else
if h=2 then
put 0 into item 1 of dicepos1
put 0 into item 6 of dicepos1
else
put 0 into item 5 of dicepos1
put 0 into item 6 of dicepos1
end if
end if
repeat with loop1=1 to 5
if item ((icon of btn loop1)-2999) of dicepos1=0 then click at loc of btn loop1
else put 0 into item ((icon of btn loop1)-2999) of dicepos1
end repeat
end holdsstraight
on rollchance
repeat with loop=1 to 5
if (icon of btn loop)-2999<5 then click at loc of btn loop
end repeat
end rollchance
on tryforlg
global dicepos
put offset("1,1,1,1",dicepos) div 2 + 1 into temp
put 0 into item (temp+3) mod 6 + 1 of dicepos
put 0 into item (temp+4) mod 6 + 1 of dicepos
repeat with loop=1 to 5
if item (icon of btn loop)-2999 of dicepos=0 then
click at loc of btn loop
exit tryforlg
else
put 0 into item (icon of btn loop)-2999 of dicepos
end if
end repeat
end tryforlg
on rollwhat roll
global dicepos, scoreval, rollfor, mac
put line 1 of card field mac is not empty and line 2 of card field mac is not empty and line 3 of card field mac is not empty and line 4 of card field mac is not empty and line 5 of card field mac is not empty and line 6 of card field mac is not empty into topfull
put line 7 of field mac is empty into upperbonus
put line 9 of field mac is empty into threeofakind
put line 10 of field mac is empty into fourofakind
put line 11 of field mac is empty into fullhouse
put line 12 of field mac is empty into shortstraight
put line 13 of field mac is empty into largestraight
put line 14 of field mac is empty into yahtzee
put line 15 of field mac is empty into chance
if rollfor is not empty then
if (icon of btn item 1 of rollfor)-2999 <> item 2 of rollfor then click at loc of btn item 1 of rollfor
exit rollwhat
end if
-- decide what's worth holding ... from 1 to 5 dice
-- if we have a small straight and lg str is free then try
-- for a large straight and we have got the upperbonus
if largestraight then if (not upperbonus or topfull) or shortstraight then if calcss()<>0 then
tryforlg
exit rollwhat
end if
-- CHECK IF WE HAVE 4 or 3 OF A KIND AND ROLL THE FIFTH FOR YAHTZEE
-- IF WE HAVE IT FREE OR IF 4 OF A KIND IS FREE OR 1-6 POS IS FREE
put false into doneit
repeat with loop=6 down to 1
put score1to6(loop) into item loop of scoreval
if item loop of scoreval>3*loop then
-- we have four of a kind
if line 10 of field mac is empty or line 14 of field mac is empty or line loop of field mac is empty then
clickonnot(loop)
exit rollwhat
end if
end if
if item loop of scoreval>2*loop then
-- we have 3 of a kind
if (threeofakind and loop>3) or (line loop of field mac is empty and upperbonus) or (fourofakind and loop>3) then
clickonnot(loop)
exit rollwhat
end if
end if
end repeat
put 0 into whatnot
put 0 into whatnot1
put false into doneit
repeat with loop=6 down to 1
if item loop of scoreval>loop then if line loop of field mac is empty then if doneit then
if roll=1 and fullhouse then
put loop into whatnot1
end if
else
put loop into whatnot
put true into doneit
end if
end repeat
if doneit then
clickonnot2 whatnot,whatnot1
exit rollwhat
end if
-- RANDOM if we have a small straight and lg str is free then try
-- for a large straight and we have not got the upperbonus
if random(2)=1 and (topfull or upperbonus) then if largestraight and calcss()<>0 then
tryforlg
exit rollwhat
end if
-- Hold 1 of a free one in 1's to 6's if we have not got upper bonus
if upperbonus and not topfull then
repeat with loop=6 down to 1
if item loop of scoreval>0 then if line loop of field mac is empty then
clickonnot loop
exit rollwhat
end if
end repeat
end if
-- if we have upperbonus then look for 3 or 4 of kind - hold 2x4 or >
if not upperbonus or topfull then if threeofakind then
repeat with loop=6 down to 5
if score1to6(loop)>loop then
clickonnot(loop)
exit rollwhat
end if
end repeat
end if
if (largestraight or shortstraight) and ((not upperbonus) or topfull) then
if largestraight and calcss()<>0 then
tryforlg
exit rollwhat
end if
if largestraight then
if not shortstraight then holdlstraight
else holdsstraight
exit rollwhat
end if
end if
if not upperbonus or topfull then if threeofakind or fourofakind then
repeat with loop=6 down to 4
if score1to6(loop)>loop then
clickonnot(loop)
exit rollwhat
end if
end repeat
repeat with loop=6 down to 5
if score1to6(loop)>0 then
clickonnot(loop)
exit rollwhat
end if
end repeat
end if
if yahtzee then
repeat with loop1=2 down to 1
repeat with loop=1 to 5
if item loop of scoreval>loop1*loop then
clickonnot(loop)
exit rollwhat
end if
end repeat
end repeat
end if
if line 18 of field 1>24 then
-- last roll
if chance then
rollchance
exit rollwhat
end if
repeat with loop=1 to 6
if line loop of field mac is empty then
clickonnot(loop)
exit rollwhat
end if
end repeat
if largestraight then
holdlstraight
exit rollwhat
end if
if shortstraight then
holdsstraight
exit rollwhat
end if
end if
if threeofakind or fourofakind then
repeat with loop=6 down to 5
if item loop of scoreval>loop then
clickonnot(loop)
exit rollwhat
end if
end repeat
end if
if fullhouse then
holdfull
exit rollwhat
end if
clickonnot 0
end rollwhat
on clickonnot di
repeat with loop1=1 to 5
if (icon of btn loop1)-2999<>di then click at loc of btn loop1
end repeat
end clickonnot
on clickonnot2 di,di1
repeat with loop1=1 to 5
put (icon of btn loop1)-2999 into temp
if (temp<>di) and (temp<>di1) then click at loc of btn loop1
end repeat
end clickonnot2
function scorer roll
global mac
-- Always score if we have Yahtzee, LG STR, or Fl House
put line 7 of field mac is empty into upperbonus
put line 9 of field mac is empty into threeofakind
put line 10 of field mac is empty into fourofakind
put line 11 of field mac is empty into fullhouse
put line 12 of field mac is empty into shortstraight
put line 13 of field mac is empty into largestraight
put line 14 of field mac is empty into yahtzee
put line 15 of field mac is empty into chance
if largestraight then
if CalcLS() <> 0 then
click at loc of card btn 18
return true
exit scorer
end if
else if shortstraight then if calcss()<>0 then
click at loc of card btn 17
return true
exit scorer
end if
if calcyahtzee()<>0 then
if yahtzee then
click at loc of btn 19
return true
exit scorer
else
if line (icon of btn 1)-2999 of field mac is empty then
click at loc of btn (7+((icon of btn 1)-2999))
return true
exit scorer
end if
end if
end if
if fullhouse then if calcfull()<>0 then
click at loc of card btn 16
return true
exit scorer
end if
if roll<>3 then
return false
exit scorer
end if
-- score aces to sixes
repeat with loop=6 down to 1
if line loop of field mac is empty then if score1to6(loop) > (2 * loop) then
click at loc of card btn (loop+7)
return true
exit scorer
end if
end repeat
-- try 4 of kind, 3 of kind or small str
if shortstraight then if CalcSS() <> 0 then
click at loc of card btn 17
return true
exit scorer
end if
repeat with loop=2 down to 1
if line (8+loop) of field mac is empty then if calckind(2+loop)>0 then
click at loc of card btn (13 + loop)
return true
exit scorer
end if
end repeat
-- try taking a chance
if chance then if calcchance()>19 then
click at loc of card btn 20
return true
exit scorer
end if
-- now we're really in trouble, don't want to start zero'ing things
-- if we have reached the upper bonus so...
if not upperbonus then
-- look for the 1st empty field 1's-6's to put a low score in
put zero into temp
repeat with loop=1 to 6
if line loop of field mac is empty then add one to temp
end repeat
if temp<>0 then
if temp=1 then
-- there no choice of where to score in 1's to 6's
repeat with loop=1 to 6
if line loop of field mac is empty then
click at loc of card button (7+loop)
return true
exit scorer
end if
end repeat
else
-- a choice of 1's to 6's to score a low score in
-- try scoring 2 of a kind
repeat with loop=1 to 6
if line loop of field mac is empty then if score1to6(loop) > loop then
click at loc of card btn (loop+7)
return true
exit scorer
end if
end repeat
-- a choice of 1's to 6's to score a low score in
-- try scoring 1 of a kind
repeat with loop=1 to 6
if line loop of field mac is empty then if score1to6(loop) > 0 then
click at loc of card btn (loop+7)
return true
exit scorer
end if
end repeat
-- a choice of 1's to 6's to score a null score in
-- put it in the lowest
repeat with loop=1 to 6
if line loop of field mac is empty then
click at loc of btn (loop+7)
return true
exit scorer
end if
end repeat
end if
end if
end if
-- try scoring in 1's to 6's if it still means we are on target for
-- the upper bonus
put 0 into temp
repeat with loop=1 to 6
if line loop of field mac is not empty then add 3*loop to temp
end repeat
put -1 into maxi
put 0 into place
repeat with loop=1 to 6
if line loop of field mac is empty then
put ((line 8 of field mac) + score1to6(loop)) into real
if real>62 then
click at loc of btn (7+loop)
return true
exit scorer
end if
put real - ((3*loop)+temp) into temp1
if temp1>maxi then
put temp1 into maxi
put loop into place
end if
end if
end repeat
if place<>0 then
click at loc of btn (7+place)
return true
exit scorer
end if
if chance then
click at loc of card btn 20
return true
exit scorer
end if
-- start putting in 0's try at the top
if line 1 of field mac is empty and (line 3 of field mac is empty or line 4 of field mac is empty or line 5 of field mac is empty or line 6 of field mac is empty) then
click at loc of btn 8
return true
exit scorer
end if
repeat with loop=15 down to 9
if line loop of field mac is empty then
click at loc of btn (5+loop)
return true
exit scorer
end if
end repeat
repeat with loop=1 to 6
if line loop of field mac is empty then
click at loc of btn (7+loop)
return true
exit scorer
end if
end repeat
end scorer
on rollwhat2
click at loc of btn 1
end rollwhat2
on macsgo
global mac, rollfor
put empty into rollfor
set cursor to 4
repeat with roll=1 to 3
if roll>1 then if not (hilite of button 1 or hilite of button 2 or hilite of button 3 or hilite of button 4 or hilite of button 5) then
if calcyahtzee()<>0 then
if line 10 of field mac is empty then
click at loc of btn 3
put "3,6" into rollfor
else if line 9 of field mac is empty then
click at loc of btn 3
click at loc of btn 4
end if
else
rollwhat2
end if
end if
if (hilite of btn 1 or hilite of btn 2 or hilite of btn 3 or hilite of btn 4 or hilite of btn 5) or roll=1 then if roll=1 then send macup to btn 6
else click at loc of btn 6
if scorer(roll) then exit macsgo
rollwhat roll
end repeat
end macsgo
on idle
global mac
if the shiftkey is down then
set visible of card window to false
wait until the shiftkey is up
set visible of card window to true
end if
if not visible of btn 37 then if line 18 of field 1<>26
then if the short name of bkgnd btn (4+mac)="Macintosh" then macsgo
end idle
on finigame
global username, mac
if hilite of bkgnd btn 8 then put 6 into offset
else put 0 into offset
if (hilite of bkgnd btn 8) or (field 5=6) then
HIDE BTN 6
HIDE BTN 7
add line 17 of field 1 to field 6
add line 17 of field 2 to field 7
show btn 37
set name of btn 21 to "New Game"
put empty into it
if the short name of bkgnd btn 5="Human" or the short name of bkgnd btn 6="Human" then
repeat while it<>"OK"
beep 2
if hilite of bkgnd btn 8
then answer "GAME OVER." with "Look" or "OK"
else answer "End of round 6. GAME OVER." with "Look" or "OK"
if it is "Look" then
wait until the mouse is down
wait until the mouse is up
end if
end repeat
end if
repeat with macloop=1 to 2
put field (5+macloop) into highscore
repeat with loop=1 to 10
if highscore>line loop of field (4+offset) then
if the short name of bkgnd btn (4+macloop)<>"Macintosh" then
put empty into it
repeat while it is empty
play harpsichord tempo 180 a4e b d a3 d4
ASK "Player #" & macloop & ": A high score! Enter your name:" with username
if it is empty then
beep 2
answer "Don't by shy, please enter your name!" with "OK"
put empty into it
end if
end repeat
else
put "The Macintosh!" into it
end if
repeat with loop1=10 down to loop
put line loop1 of field (4+offset) into line loop1+1 of field (4+offset)
put line loop1 of field (3+offset) into line loop1+1 of field (3+offset)
end repeat
put it into line loop of field (3+offset)
put highscore into line loop of field (4+offset)
exit repeat
end if
end repeat
end repeat
else
add line 17 of field 1 to field 6
add line 17 of field 2 to field 7
put empty into it
if the short name of bkgnd btn 5="Human" or the short name of bkgnd btn 6="Human" then
repeat while it<>"OK"
beep 2
answer "End of round" && field 5 & ". Click OK for next round." with "Look" or "OK"
if it is "Look" then
wait until the mouse is down
wait until the mouse is up
end if
end repeat
end if
add one to field 5
put 1 into mac
put empty into field 1
put 0 into line 18 of field 1
put empty into field 2
hide btn 7
set name of card btn 7 to "Roll 2"
show btn 6
set lockscreen to true
repeat with loop=1 to 5
hide btn loop
end repeat
set hilite of btn 34 to true
set lockscreen to false
end if
end finigame
on finishscore1
global mac
set lockscreen to true
hide btn 7
set name of btn 7 to "Roll 2"
show btn 6
REPEAT WITH LOOP=1 TO 5
SET HILITE OF BTN LOOP TO FALSE
END REPEAT
set lockscreen to false
put 2-((mac+1) mod 2) into mac
set hilite of card btn 34 to (mac=1)
if line 18 of field 1 = 26 then finigame
end finishscore1
on checkempty b
global mac
if line b of field mac is not empty then
if line 18 of field 1 <> 26 then
beep 2
answer "You've already scored here!" with "OK"
exit to hypercard
ELSE
EXIT TO HYPERCARD
END IF
end if
end checkempty
function CalcKind Num
put "0,0,0,0,0,0" into amount
repeat with loop=1 to 5
add one to item (icon of btn loop)-2999 of amount
end repeat
repeat with loop=1 to 6
if item loop of amount ‚â• num then
put empty into total
repeat with loop=1 to 5
add (icon of btn loop)-2999 to total
end repeat
return total
exit CalcKind
end if
end repeat
return 0
end CalcKind
function CalcFull
put "0,0,0,0,0,0" into amount
repeat with loop=1 to 5
add one to item (icon of btn loop)-2999 of amount
end repeat
if amount contains 2 and amount contains 3 then
return 25
else
return 0
end if
end CalcFull
function CalcLS
put "0,0,0,0,0,0" into amount
repeat with loop=1 to 5
put 1 into item (icon of btn loop)-2999 of amount
end repeat
if amount contains "1,1,1,1,1" then
return 40
else
return 0
end if
end CalcLS
function CalcSS
global dicepos
put "0,0,0,0,0,0" into dicepos
repeat with loop=1 to 5
put 1 into item (icon of btn loop)-2999 of dicepos
end repeat
if dicepos contains "1,1,1,1" then
return 30
else
return 0
end if
end CalcSS
function CalcChance
put 0 into total
repeat with loop=1 to 5
add (icon of btn loop)-2999 to total
end repeat
return total
end CalcChance
function CalcYahtzee
if icon of btn 1 = icon of btn 2 then
if icon of btn 2 = icon of btn 3 then
if icon of btn 3 = icon of btn 4 then
if icon of btn 4 = icon of btn 5 then
return 50
exit CalcYahtzee
end if
end if
end if
end if
return 0
end CalcYahtzee
function score1to6 val
put 0 into total
repeat with loop=1 to 5
if (icon of btn loop)-2999=val then add val to total
end repeat
return total
end score1to6
on sumgrand
global mac
put line 8 of field mac into grandtotal
add line 16 of field mac to grandtotal
put grandtotal into line 17 of field mac
finishscore1
end sumgrand
on sumupper
global mac
put empty into uppertotal
repeat with loop=1 to 6
add line loop of field mac to uppertotal
end repeat
if uppertotal > 62 then
put 35 into line 7 of field mac
add 35 to uppertotal
else
put empty into line 7 of field mac
end if
put uppertotal into line 8 of field mac
sumgrand
end sumupper
on sumlower
global mac
put empty into lowertotal
repeat with loop=9 to 15
add line loop of field mac to lowertotal
end repeat
put lowertotal into line 16 of field mac
sumgrand
end sumlower
on holderr
beep 2
answer "You must roll all five dice to begin." with "OK"
end holderr
on holderr1
if line 18 of field 1 <> 26 then
beep 2
answer "You've had 3 rolls. Please score now." with "OK"
END IF
end holderr1
on checkrolled
set cursor to 4
if visible of btn 6 then
beep 2
answer "You must roll the dice before scoring!" with "OK"
exit to hypercard
end if
end checkrolled
-- part 2 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=15 top=35 right=69 bottom=49
-- title width / last selected line: 0
-- icon id / first selected line: 3004 / 3004
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Button
----- HyperTalk script -----
on mouseUp
if visible of btn 7 then
SET HILITE OF ME TO NOT HILITE OF ME
else
if visible of button 6 then
holderr
else
holderr1
end if
end if
end mouseUp
-- part 4 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=15 top=86 right=120 bottom=49
-- title width / last selected line: 0
-- icon id / first selected line: 3001 / 3001
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Button
----- HyperTalk script -----
on mouseUp
if visible of btn 7 then
SET HILITE OF ME TO NOT HILITE OF ME
else
if visible of button 6 then
holderr
else
holderr1
end if
end if
end mouseUp
-- part 5 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=15 top=137 right=171 bottom=49
-- title width / last selected line: 0
-- icon id / first selected line: 3005 / 3005
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Button
----- HyperTalk script -----
on mouseUp
if visible of btn 7 then
SET HILITE OF ME TO NOT HILITE OF ME
else
if visible of button 6 then
holderr
else
holderr1
end if
end if
end mouseUp
-- part 6 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=15 top=188 right=222 bottom=49
-- title width / last selected line: 0
-- icon id / first selected line: 3001 / 3001
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Button
----- HyperTalk script -----
on mouseUp
if visible of btn 7 then
SET HILITE OF ME TO NOT HILITE OF ME
else
if visible of button 6 then
holderr
else
holderr1
end if
end if
end mouseUp
-- part 7 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=15 top=239 right=273 bottom=49
-- title width / last selected line: 0
-- icon id / first selected line: 3002 / 3002
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Button
----- HyperTalk script -----
on mouseUp
if visible of btn 7 then
SET HILITE OF ME TO NOT HILITE OF ME
else
if visible of button 6 then
holderr
else
holderr1
end if
end if
end mouseUp
-- part 9 (button)
-- low flags: 80
-- high flags: A003
-- rect: left=7 top=283 right=335 bottom=57
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Roll 1
----- HyperTalk script -----
on mouseUp
global mac
if the short name of bkgnd btn (4+mac)="Human" then
SET CURSOR TO 4
add one to line 18 of field 1
set visible of me to false
SET LOCKSCREEN TO TRUE
repeat with loop=1 to 5
set hilite of btn loop to false
hide btn loop
end repeat
set lockscreen to false
set lockscreen to true
repeat with loop=1 to 5
SET ICON OF BTN loop TO (2999+RANDOM(6))
show btn loop
end repeat
show btn 7
SET LOCKSCREEN TO FALSE
end if
end mouseUp
on MacUp
SET CURSOR TO 4
set hilite of me to true
set hilite of me to false
add one to line 18 of field 1
set visible of me to false
SET LOCKSCREEN TO TRUE
repeat with loop=1 to 5
set hilite of btn loop to false
hide btn loop
end repeat
set lockscreen to false
set lockscreen to true
repeat with loop=1 to 5
SET ICON OF BTN loop TO (2999+RANDOM(6))
show btn loop
end repeat
show btn 7
SET LOCKSCREEN TO FALSE
end macup
-- part 10 (button)
-- low flags: 80
-- high flags: A003
-- rect: left=7 top=283 right=335 bottom=57
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Roll 2
----- HyperTalk script -----
on mouseUp
SET CURSOR TO 4
IF NOT (HILITE OF BTN 1 OR HILITE OF BTN 2 OR HILITE OF BTN 3 OR HILITE OF BTN 4 OR HILITE OF BTN 5) THEN
beep 2
answer "Click on dice to re-roll." with "OK"
exit mouseup
end if
hide btn 7
set lockscreen to true
repeat with loop=1 to 5
PUT HILITE OF BTN LOOP INTO ITEM LOOP OF RR
if hilite of btn loop then set visible of btn loop to false
SET HILITE OF BTN LOOP TO FALSE
end repeat
SET LOCKSCREEN TO false
set lockscreen to true
REPEAT WITH LOOP1=1 TO 5
IF ITEM LOOP1 OF RR THEN
SET ICON OF BTN LOOP1 TO (2999+RANDOM(6))
set visible of btn loop1 to true
end if
END REPEAT
SET LOCKSCREEN TO FALSE
IF THE SHORT NAME OF ME<>"Roll 3" THEN
SET THE NAME OF ME TO "Roll 3"
show btn 7
ELSE
SET NAME OF ME TO "Roll 2"
END IF
end mouseUp
-- part 14 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=46 right=60 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
CHECKEMPTY 1
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put score1to6(1) into line 1 of field mac
sumupper
end mouseUp
-- part 27 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=62 right=76 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
CHECKEMPTY 2
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put score1to6(2) into line 2 of field mac
sumupper
end mouseUp
-- part 28 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=78 right=92 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
CHECKEMPTY 3
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put score1to6(3) into line 3 of field mac
sumupper
end mouseUp
-- part 29 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=94 right=108 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
CHECKEMPTY 4
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put score1to6(4) into line 4 of field mac
sumupper
end mouseUp
-- part 30 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=110 right=124 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
CHECKEMPTY 5
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put score1to6(5) into line 5 of field mac
sumupper
end mouseUp
-- part 31 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=126 right=140 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
CHECKEMPTY 6
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put score1to6(6) into line 6 of field mac
sumupper
end mouseUp
-- part 34 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=174 right=188 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
CHECKEMPTY 9
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put CalcKind(3) into line 9 of field mac
sumlower
end mouseUp
-- part 35 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=190 right=204 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
CHECKEMPTY 10
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put CalcKind(4) into line 10 of field mac
sumlower
end mouseUp
-- part 36 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=206 right=220 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
CHECKEMPTY 11
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put CalcFull() into line 11 of field mac
sumlower
end mouseUp
-- part 37 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=222 right=236 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
CHECKEMPTY 12
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put CalcsS() into line 12 of field mac
sumlower
end mouseUp
-- part 38 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=238 right=252 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
checkempty 13
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put CalcLS() into line 13 of field mac
sumlower
end mouseUp
-- part 41 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=254 right=268 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
checkempty 14
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put CalcYahtzee() into line 14 of field mac
sumlower
end mouseUp
-- part 42 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=66 top=270 right=284 bottom=338
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
global mac
if not gameon() then exit mouseup
if the short name of bkgnd btn (4+Mac)="Human" then
checkrolled
checkempty 15
end if
REPEAT WITH LOOP=1 TO 4
SET HILITE OF ME TO NOT HILITE OF ME
END REPEAT
put calcchance() into line 15 of field mac
sumlower
end mouseUp
-- part 44 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=362 top=23 right=45 bottom=492
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: New Game
----- HyperTalk script -----
on mouseUp
global mac
if not visible of btn 37 then
beep 2
answer "Abandon current game?" with "OK" or "Cancel"
if it is "Cancel" then exit mouseup
set lockscreen to true
set name of me to "New Game"
show card btn 37
repeat with loop=1 to 7
hide btn loop
end repeat
set lockscreen to false
exit mouseup
end if
put 1 into mac
put empty into field 1
put 0 into line 18 of field 1
PUT 0 INTO FIELD 6
PUT 0 INTO FIELD 7
put empty into field 2
hide btn 7
set name of card btn 7 to "Roll 2"
show btn 6
set lockscreen to true
repeat with loop=1 to 5
hide btn loop
end repeat
if hilite of bkgnd btn 2 then set name of bkgnd btn 5 to "Macintosh"
else set name of bkgnd btn 5 to "Human"
if hilite of bkgnd btn 4 then set name of bkgnd btn 6 to "Macintosh"
Hyper-Yahtzee is the traditional game of Yahtzee. You play either 1 or 6 rounds of Yahtzee against the Macintosh, with the challenge of trying to get your name on the corresponding Top Ten High Scores and not forgetting to attempt to beati the Mac!
If you like Hyper-Yahtzee and want to encourage the development of similar stacks then I ask you to either pay for this stack or pass it on to a friend and delete your copy. Support Stackware! Send whatever you think it is worth to:
Ian Summerfield
60 Tenby Drive
Luton, Bedfordshire
England, LU4 9BL
AppleFone Bulletin Board System for HyperCarders is on 0582 584134.
-- part contents for card part 82
----- text -----
You cannot score on "Bonus".
A bonus of 35 points is given to you if you score 63 or above on the upper total.
One way to reach the required 63 points is to score 3 ones, 3 twos,